//
//  DataHandle.h
//  Menu
//
//  Created by dllo on 15/7/2.
//  Copyright (c) 2015年 lijiangang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
#import "VideoModel.h"
#import "CollectModel.h"
#import "HomePageModel.h"
#import "GoodModel.h"
#import "NewsListModel.h"
#import "CaudleModel.h"
#import "VideoModel.h"

@interface DataHandle : NSObject

+(instancetype)shareData;
-(void)openDataBase;

-(void)createVideoInfoTable;
-(void)insertVideoInfo:(VideoModel *)theVideo;
-(NSMutableArray *)selectVideoInfoTable;
-(void)createSearchHistoryTable;
-(void)insertSearchInfoToHistoryTable:(NSString *)searchText;
-(NSMutableArray *)selectSearchHistoryTable;
-(void)dropSearchHistoryTable;
-(void)deleteOneOfSearch:(NSString *)searchText;

//------------收藏表----------------
-(void)createCollectInfoTable;
-(void)insertCollectInfo:(CollectModel *)theCollect;
-(NSMutableArray *)selectCollectInfoTabel;
-(void)deleteCollectTable:(NSString *)foodName;
-(void)dropTable;

//-----------首页缓存表--------------
-(void)createHomeCacheTable;
-(void)insertHomeCache:(HomePageModel *)homeModel;
-(NSMutableArray *)selectHomeCacheTable;
-(void)dropHomeCacheTable;

//-----------精品汇缓存表--------------
-(void)createGoodCacheTable;
-(void)insertGoodCacheTable:(GoodModel *)goodModel;
-(NSMutableArray *)selectGoodCacheTable;
-(void)dropGoodCacheTable;

//-----------新鲜事缓存表--------------
-(void)createNewsCacheTable;
-(void)insertNewsCacheTable:(NewsListModel *)newsModel;
-(NSMutableArray *)selectNewsCacheTable;
-(void)dropNewsCacheTable;

//-----------粥汤TableView缓存表--------------
-(void)createCaudleListCacheTable;
-(void)insertCaudleListCacheTable:(CaudleModel *)caudleModel;
-(NSMutableArray *)selectCaudleListCacheTable;
-(void)dropCaudleListCacheTable;

//-----------粥汤CollectionView缓存表--------------
-(void)createCaudleCacheTable;
-(void)insertCaudleCacheTable:(CaudleModel *)caudleModel;
-(NSMutableArray *)selectCaudleCacheTable;
-(void)dropCaudleCacheTable;
-(void)deleteCaudleCacheTable:(NSString *)typeId;
-(NSMutableArray *)selectCaudleCacheTable:(NSString *)typeId;

//-----------视频教程缓存表--------------
-(void)createVideoCacheTable;
-(void)insertVideoCacheTable:(VideoModel *)videoModel;
-(NSMutableArray *)selectVideoCacheTable;
-(void)dropVideoCacheTable;
-(NSMutableArray *)selectVideoCacheTable:(NSString *)type;

//------------随机一下--------------------
-(void)createRandomTable;
-(void)insertRandomTable:(GoodModel *)caudleModel;
-(NSMutableArray *)selectRandomTable;
-(void)dropRondomTable;
@end












